home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume6 / xlisp1.6 / part4 < prev    next >
Encoding:
Internet Message Format  |  1986-11-30  |  43.0 KB

  1. Subject:  v06i110:  Xlisp version 1.6 (xlisp1.6), Part04/06
  2. Newsgroups: mod.sources
  3. Approved: rs@mirror.UUCP
  4.  
  5. Submitted by: seismo!utah-cs!b-davis (Brad Davis)
  6. Mod.sources: Volume 6, Issue 110
  7. Archive-name: xlisp1.6/Part04
  8.  
  9.  
  10. #! /bin/sh
  11. # This is a shell archive, meaning:
  12. # 1. Remove everything above the #! /bin/sh line.
  13. # 2. Save the resulting text in a file.
  14. # 3. Execute the file with /bin/sh (not csh) to create the files:
  15. #    Make.lattice
  16. #    Makefile
  17. #    asstuff.c
  18. #    msstuff.c
  19. #    pcfun.doc
  20. #    pcstuff.c
  21. #    psstuff.c
  22. #    readme.1st
  23. #    unixstuff.c
  24. #    xlisp.h
  25. # This archive created: Mon Jul 14 10:24:59 1986
  26. export PATH; PATH=/bin:$PATH
  27. if test -f 'Make.lattice'
  28. then
  29.     echo shar: will not over-write existing file "'Make.lattice'"
  30. else
  31. cat << \SHAR_EOF > 'Make.lattice'
  32. # Because of braindamage in the Lattice runtime environment, where
  33. # printf and friends are incapable of dealing with long strings, we
  34. # must break up the list of files into managable pieces and join them
  35. # in archives before linking.  Jeez...
  36.  
  37. SRC1 =    xlobj.c xllist.c xlcont.c xlbfun.c
  38. SRC2 =    xldmem.c xleval.c xlfio.c xlftab.c xlglob.c xlio.c xlisp.c xljump.c
  39. SRC2a =    xlmath.c xlprin.c xlread.c xlinit.c
  40. SRC3 =    xlstr.c xlsubr.c xlsym.c xlsys.c xldbug.c asstuff.c
  41. SRCS =    $(SRC1) $(SRC2) $(SRC2a) $(SRC3) xlisp.h
  42.  
  43. OBJS1 =    xlbfun.o xlcont.o xldbug.o xldmem.o xleval.o xlfio.o
  44. OBJS2 =    xlftab.o xlglob.o xlinit.o xlio.o xlisp.o xljump.o xllist.o xlmath.o
  45. OBJS3 =    xlobj.o xlprin.o xlread.o xlstr.o xlsubr.o xlsym.o xlsys.o asstuff.o
  46. OBJS =    lib1.o lib2.o lib3.o
  47.  
  48. MISC1 =    Makefile fact.lsp init.lsp object.lsp prolog.lsp trace.lsp 
  49. MISC2 =    xlstub.c.NOTUSED 
  50. MISC  =    $(MISC1) $(MISC2)
  51.  
  52. CFLAGS =    -O
  53. CC  =        cc
  54. #LIBS =        -lm
  55.  
  56. xlisp :        $(OBJS)
  57.         $(CC) -o xlisp $(CFLAGS) $(OBJS) $(LIBS)
  58.  
  59. lib1.o :    $(OBJS1)
  60.         join $(OBJS1) as lib1.o
  61.  
  62. lib2.o :    $(OBJS2)
  63.         join $(OBJS2) as lib2.o
  64.  
  65. lib3.o :    $(OBJS3)
  66.         join $(OBJS3) as lib3.o
  67.  
  68. clean :
  69.         delete $(OBJS)
  70.         delete $(OBJS1)
  71.         delete $(OBJS2)
  72.         delete $(OBJS3)
  73.  
  74.  
  75. xlbfun.o :    xlbfun.c xlisp.h
  76.         $(CC) -c $(CFLAGS) xlbfun.c
  77.  
  78. xlcont.o :    xlcont.c xlisp.h
  79.         $(CC) -c $(CFLAGS) xlcont.c
  80.  
  81. xldbug.o :    xldbug.c xlisp.h
  82.         $(CC) -c $(CFLAGS) xldbug.c
  83.  
  84. xldmem.o :    xldmem.c xlisp.h
  85.         $(CC) -c $(CFLAGS) xldmem.c
  86.  
  87. xleval.o :    xleval.c xlisp.h
  88.         $(CC) -c $(CFLAGS) xleval.c
  89.  
  90. xlfio.o :    xlfio.c xlisp.h
  91.         $(CC) -c $(CFLAGS) xlfio.c
  92.  
  93. xlftab.o :    xlftab.c xlisp.h
  94.         $(CC) -c $(CFLAGS) xlftab.c
  95.  
  96. xlglob.o :    xlglob.c xlisp.h
  97.         $(CC) -c $(CFLAGS) xlglob.c
  98.  
  99. xlinit.o :    xlinit.c xlisp.h
  100.         $(CC) -c $(CFLAGS) xlinit.c
  101.  
  102. xlio.o :    xlio.c xlisp.h
  103.         $(CC) -c $(CFLAGS) xlio.c
  104.  
  105. xlisp.o :    xlisp.c xlisp.h
  106.         $(CC) -c $(CFLAGS) xlisp.c
  107.  
  108. xljump.o :    xljump.c xlisp.h
  109.         $(CC) -c $(CFLAGS) xljump.c
  110.  
  111. xllist.o :    xllist.c xlisp.h
  112.         $(CC) -c $(CFLAGS) xllist.c
  113.  
  114. xlmath.o :    xlmath.c xlisp.h
  115.         $(CC) -c $(CFLAGS) xlmath.c
  116.  
  117. xlobj.o :    xlobj.c xlisp.h
  118.         $(CC) -c $(CFLAGS) xlobj.c
  119.  
  120. xlprin.o :    xlprin.c xlisp.h
  121.         $(CC) -c $(CFLAGS) xlprin.c
  122.  
  123. xlread.o :    xlread.c xlisp.h
  124.         $(CC) -c $(CFLAGS) xlread.c
  125.  
  126. xlstr.o :    xlstr.c xlisp.h
  127.         $(CC) -c $(CFLAGS) xlstr.c
  128.  
  129. xlstub.o :    xlstub.c xlisp.h
  130.         $(CC) -c $(CFLAGS) xlstub.c
  131.  
  132. xlsubr.o :    xlsubr.c xlisp.h
  133.         $(CC) -c $(CFLAGS) xlsubr.c
  134.  
  135. xlsym.o :    xlsym.c xlisp.h
  136.         $(CC) -c $(CFLAGS) xlsym.c
  137.  
  138. xlsys.o :    xlsys.c xlisp.h
  139.         $(CC) -c $(CFLAGS) xlsys.c
  140.  
  141. asstuff.o :    asstuff.c
  142.         $(CC) -c $(CFLAGS) asstuff.c
  143. SHAR_EOF
  144. fi # end of overwriting check
  145. if test -f 'Makefile'
  146. then
  147.     echo shar: will not over-write existing file "'Makefile'"
  148. else
  149. cat << \SHAR_EOF > 'Makefile'
  150. OS=unix
  151.  
  152. SRC1 =    xlobj.c xllist.c xlcont.c xlbfun.c
  153. SRC2 =    xldmem.c xleval.c xlfio.c xlftab.c xlglob.c xlio.c xlisp.c xljump.c
  154. SRC2a =    xlmath.c xlprin.c xlread.c xlinit.c
  155. SRC3 =    xlstr.c xlsubr.c xlsym.c xlsys.c xldbug.c $(OS)stuff.c
  156. SRCS =    $(SRC1) $(SRC2) $(SRC2a) $(SRC3) xlisp.h
  157.  
  158. OBJS1 =    xlbfun.o xlcont.o xldbug.o xldmem.o xleval.o xlfio.o
  159. OBJS2 =    xlftab.o xlglob.o xlinit.o xlio.o xlisp.o xljump.o xllist.o xlmath.o
  160. OBJS3 =    xlobj.o xlprin.o xlread.o xlstr.o xlsubr.o xlsym.o xlsys.o $(OS)stuff.o
  161. OBJS =    $(OBJS1) $(OBJS2) $(OBJS3)
  162.  
  163. MISC1 =    Makefile fact.lsp init.lsp object.lsp prolog.lsp trace.lsp 
  164. MISC2 =    xlstub.c.NOTUSED 
  165. MISC  =    $(MISC1) $(MISC2)
  166.  
  167. CFLAGS =    -O
  168. CC  =        cc
  169. LIBS =        -lm
  170.  
  171. xlisp : $(OBJS)
  172.     cc -o xlisp.unix $(CFLAGS) $(OBJS) $(LIBS)
  173.  
  174. rcs : $(SRCS)
  175.     rcs -l $?
  176.     touch rcs
  177.  
  178. lint :
  179.     lint -ach $(SRCS)
  180.  
  181. new : clean
  182.     rm -f xlisp
  183.     make xlisp
  184.  
  185. clean :
  186.     rm -f *.o
  187.  
  188. shar : $(SRCS) $(MISC)
  189.     shar -c -v xlisp.doc > xlisp1.shar
  190.     shar -c -v $(SRC1) > xlisp2.shar
  191.     shar -c -v $(SRC2) > xlisp3.shar
  192.     shar -c -v $(SRC3) $(MISC) > xlisp4.shar
  193.  
  194.  
  195. xlbfun.o :    xlbfun.c xlisp.h
  196.         $(CC) -c $(CFLAGS) xlbfun.c
  197.  
  198. xlcont.o :    xlcont.c xlisp.h
  199.         $(CC) -c $(CFLAGS) xlcont.c
  200.  
  201. xldbug.o :    xldbug.c xlisp.h
  202.         $(CC) -c $(CFLAGS) xldbug.c
  203.  
  204. xldmem.o :    xldmem.c xlisp.h
  205.         $(CC) -c $(CFLAGS) xldmem.c
  206.  
  207. xleval.o :    xleval.c xlisp.h
  208.         $(CC) -c $(CFLAGS) xleval.c
  209.  
  210. xlfio.o :    xlfio.c xlisp.h
  211.         $(CC) -c $(CFLAGS) xlfio.c
  212.  
  213. xlftab.o :    xlftab.c xlisp.h
  214.         $(CC) -c $(CFLAGS) xlftab.c
  215.  
  216. xlglob.o :    xlglob.c xlisp.h
  217.         $(CC) -c $(CFLAGS) xlglob.c
  218.  
  219. xlinit.o :    xlinit.c xlisp.h
  220.         $(CC) -c $(CFLAGS) xlinit.c
  221.  
  222. xlio.o :    xlio.c xlisp.h
  223.         $(CC) -c $(CFLAGS) xlio.c
  224.  
  225. xlisp.o :    xlisp.c xlisp.h
  226.         $(CC) -c $(CFLAGS) xlisp.c
  227.  
  228. xljump.o :    xljump.c xlisp.h
  229.         $(CC) -c $(CFLAGS) xljump.c
  230.  
  231. xllist.o :    xllist.c xlisp.h
  232.         $(CC) -c $(CFLAGS) xllist.c
  233.  
  234. xlmath.o :    xlmath.c xlisp.h
  235.         $(CC) -c $(CFLAGS) xlmath.c
  236.  
  237. xlobj.o :    xlobj.c xlisp.h
  238.         $(CC) -c $(CFLAGS) xlobj.c
  239.  
  240. xlprin.o :    xlprin.c xlisp.h
  241.         $(CC) -c $(CFLAGS) xlprin.c
  242.  
  243. xlread.o :    xlread.c xlisp.h
  244.         $(CC) -c $(CFLAGS) xlread.c
  245.  
  246. xlstr.o :    xlstr.c xlisp.h
  247.         $(CC) -c $(CFLAGS) xlstr.c
  248.  
  249. xlstub.o :    xlstub.c xlisp.h
  250.         $(CC) -c $(CFLAGS) xlstub.c
  251.  
  252. xlsubr.o :    xlsubr.c xlisp.h
  253.         $(CC) -c $(CFLAGS) xlsubr.c
  254.  
  255. xlsym.o :    xlsym.c xlisp.h
  256.         $(CC) -c $(CFLAGS) xlsym.c
  257.  
  258. xlsys.o :    xlsys.c xlisp.h
  259.         $(CC) -c $(CFLAGS) xlsys.c
  260.  
  261. $(OS)stuff.o :    $(OS)stuff.c
  262.         $(CC) -c $(CFLAGS) $(OS)stuff.c
  263. SHAR_EOF
  264. fi # end of overwriting check
  265. if test -f 'asstuff.c'
  266. then
  267.     echo shar: will not over-write existing file "'asstuff.c'"
  268. else
  269. cat << \SHAR_EOF > 'asstuff.c'
  270. /* asstuff.c - Amiga specific routines */
  271.  
  272. #include "xlisp.h"
  273.  
  274. #ifndef MANX
  275. #define agetc getc    /* Not sure if this will work in all cases (fnf) */
  276. #define aputc putc    /* Not sure if this will work in all cases (fnf) */
  277. #endif
  278.  
  279. #define LBSIZE 200
  280.  
  281. /* external routines */
  282. extern double ran();
  283.  
  284. /* external variables */
  285. extern NODE *s_unbound,*true;
  286. extern int prompt;
  287. extern int errno;
  288.  
  289. /* line buffer variables */
  290. static char lbuf[LBSIZE];
  291. static int  lpos[LBSIZE];
  292. static int lindex;
  293. static int lcount;
  294. static int lposition;
  295.  
  296. #define NEW 1006
  297. static long xlispwindow;
  298.  
  299. /* osinit - initialize */
  300. osinit(banner)
  301.   char *banner;
  302. {
  303.     extern int Enable_Abort;
  304.  
  305.     Enable_Abort = 0;        /* Turn off ^C interrupt in case it's on */
  306.     xlispwindow = Open("RAW:1/1/639/199/Xlisp by David Betz", NEW);
  307.     while (*banner != '\000') {
  308.     xputc (*banner++);
  309.     }
  310.     xputc ('\n');
  311.     lposition = 0;
  312.     lindex = 0;
  313.     lcount = 0;
  314. }
  315.  
  316. osfinish ()
  317. {
  318.     Close (xlispwindow);
  319. }
  320.  
  321. /* osrand - return a random number between 0 and n-1 */
  322. int osrand(n)
  323.   int n;
  324. {
  325.     n = (int)(ran() * (double)n);
  326.     return (n < 0 ? -n : n);
  327. }
  328.  
  329. /* osgetc - get a character from the terminal */
  330. int osgetc(fp)
  331.   FILE *fp;
  332. {
  333.     int ch;
  334.  
  335.     /* check for input from a file other than stdin */
  336.     if (fp != stdin)
  337.     return ((int)agetc(fp));
  338.  
  339.     /* check for a buffered character */
  340.     if (lcount--)
  341.     return ((int)lbuf[lindex++]);
  342.  
  343.     /* get an input line */
  344.     for (lcount = 0; ; )
  345.     switch (ch = xgetc()) {
  346.     case '\n':
  347.     case '\r':
  348.         lbuf[lcount++] = '\n';
  349.         xputc('\r'); xputc('\n'); lposition = 0;
  350.         lindex = 0; lcount--;
  351.         return ((int)lbuf[lindex++]);
  352.     case '\010':
  353.     case '\177':
  354.         if (lcount) {
  355.             lcount--;
  356.             while (lposition > lpos[lcount]) {
  357.             xputc('\010'); xputc(' '); xputc('\010');
  358.             lposition--;
  359.             }
  360.         }
  361.         break;
  362.     case '\032':
  363.         osflush();
  364.         return (EOF);
  365.     default:
  366.         if (ch == '\t' || (ch >= 0x20 && ch < 0x7F)) {
  367.             lbuf[lcount] = ch;
  368.             lpos[lcount] = lposition;
  369.             if (ch == '\t')
  370.             do {
  371.                 xputc(' ');
  372.             } while (++lposition & 7);
  373.             else {
  374.             xputc(ch); lposition++;
  375.             }
  376.             lcount++;
  377.         }
  378.         else {
  379.             osflush();
  380.             switch (ch) {
  381.             case '\003':    xltoplevel();    /* control-c */
  382.             case '\007':    xlcleanup();    /* control-g */
  383.             case '\020':    xlcontinue();    /* control-p */
  384.             case '\032':    return (EOF);    /* control-z */
  385.             default:        return (ch);
  386.             }
  387.         }
  388.     }
  389. }
  390.  
  391. /* osputc - put a character to the terminal */
  392. osputc(ch,fp)
  393.   int ch; FILE *fp;
  394. {
  395.     /* check for output to something other than stdout */
  396.     if (fp != stdout)
  397.     return (aputc(ch,fp));
  398.  
  399.     /* check for control characters */
  400.     oscheck();
  401.  
  402.     /* output the character */
  403.     if (ch == '\n') {
  404.     xputc('\r'); xputc('\n');
  405.     lposition = 0;
  406.     }
  407.     else {
  408.     xputc(ch);
  409.     lposition++;
  410.    }
  411. }
  412.  
  413. /* oscheck - check for control characters during execution */
  414. oscheck()
  415. {
  416.     int ch;
  417.     if (ch = xcheck())
  418.     switch (ch) {
  419.     case '\002':    osflush(); xlbreak("BREAK",s_unbound); break;
  420.     case '\003':    osflush(); xltoplevel(); break;
  421.     }
  422. }
  423.  
  424. /* osflush - flush the input line buffer */
  425. osflush()
  426. {
  427.     lindex = lcount = 0;
  428.     osputc('\n',stdout);
  429.     prompt = 1;
  430. }
  431.  
  432. /* xgetc - get a character from the terminal without echo */
  433. static int xgetc()
  434. {
  435.     char ch;
  436.  
  437.     Read (xlispwindow, &ch, 1);
  438.     return (ch & 0xFF);
  439. }
  440.  
  441. /* xputc - put a character to the terminal */
  442. static xputc(ch)
  443.   int ch;
  444. {
  445.     char chout;
  446.  
  447.     chout = ch;
  448.     Write (xlispwindow, &chout, 1L);
  449. }
  450.  
  451. /* xcheck - check for a character */
  452. static int xcheck()
  453. {
  454.     if (WaitForChar (xlispwindow, 0L) == 0L)
  455.     return (0);
  456.     return (xgetc() & 0xFF);
  457. }
  458.  
  459. /* xdos - execute a dos command */
  460. NODE *xdos(args)
  461.   NODE *args;
  462. {
  463.     char *cmd;
  464.     cmd = xlmatch(STR,&args)->n_str;
  465.     xllastarg(args);
  466.     return (system(cmd) == -1 ? cvfixnum((FIXNUM)errno) : true);
  467. }
  468.  
  469. int system (cmd)
  470. char *cmd;
  471. {
  472.     return (Execute(cmd, 0L, xlispwindow));
  473. }
  474.  
  475. double ran ()    /* Just punt for now, not in Manx C; FIXME!!*/
  476. {
  477.     static long seed = 654321;
  478.     long lval;
  479.     double dval;
  480.  
  481.     seed *= ((8 * (123456) - 3));
  482.     lval = seed & 0xFFFF;
  483.     dval = ((double) lval) / ((double) (0x10000));
  484.     return (dval);
  485. }
  486.     
  487. /* xgetkey - get a key from the keyboard */
  488. NODE *xgetkey(args)
  489.   NODE *args;
  490. {
  491.     xllastarg(args);
  492.     return (cvfixnum((FIXNUM)xgetc()));
  493. }
  494.  
  495. #ifdef DEADCODE    /* Dont' use this for now?  (fnf) */
  496.  
  497. /* xcursor - set the cursor position */
  498. NODE *xcursor(args)
  499.   NODE *args;
  500. {
  501.     int row,col;
  502.     row = xlmatch(INT,&args)->n_int;
  503.     col = xlmatch(INT,&args)->n_int;
  504.     xllastarg(args);
  505.     scr_curs(row,col);
  506.     return (NIL);
  507. }
  508.  
  509. /* xclear - clear the screen */
  510. NODE *xclear(args)
  511.   NODE *args;
  512. {
  513.     xllastarg(args);
  514.     scr_clear();
  515.     return (NIL);
  516. }
  517.  
  518. /* xeol - clear to end of line */
  519. NODE *xeol(args)
  520.   NODE *args;
  521. {
  522.     xllastarg(args);
  523.     scr_eol();
  524.     return (NIL);
  525. }
  526.  
  527.  
  528. /* xeos - clear to end of screen */
  529. NODE *xeos(args)
  530.   NODE *args;
  531. {
  532.     xllastarg(args);
  533.     scr_eos();
  534.     return (NIL);
  535. }
  536.  
  537. /* xlinsert - insert line */
  538. NODE *xlinsert(args)
  539.   NODE *args;
  540. {
  541.     xllastarg(args);
  542.     scr_linsert();
  543.     return (NIL);
  544. }
  545.  
  546. /* xldelete - delete line */
  547. NODE *xldelete(args)
  548.   NODE *args;
  549. {
  550.     xllastarg(args);
  551.     scr_ldelete();
  552.     return (NIL);
  553. }
  554.  
  555. /* xcinsert - insert character */
  556. NODE *xcinsert(args)
  557.   NODE *args;
  558. {
  559.     xllastarg(args);
  560.     scr_cinsert();
  561.     return (NIL);
  562. }
  563.  
  564. /* xcdelete - delete character */
  565. NODE *xcdelete(args)
  566.   NODE *args;
  567. {
  568.     xllastarg(args);
  569.     scr_cdelete();
  570.     return (NIL);
  571. }
  572.  
  573. /* xinverse - set/clear inverse video */
  574. NODE *xinverse(args)
  575.   NODE *args;
  576. {
  577.     NODE *val;
  578.     val = xlarg(&args);
  579.     xllastarg(args);
  580.     scr_invers(val ? 1 : 0);
  581.     return (NIL);
  582. }
  583.  
  584. /* xline - draw a line */
  585. NODE *xline(args)
  586.   NODE *args;
  587. {
  588.     int x1,y1,x2,y2;
  589.     x1 = xlmatch(INT,&args)->n_int;
  590.     y1 = xlmatch(INT,&args)->n_int;
  591.     x2 = xlmatch(INT,&args)->n_int;
  592.     y2 = xlmatch(INT,&args)->n_int;
  593.     xllastarg(args);
  594.     line(x1,y1,x2,y2);
  595.     return (NIL);
  596. }
  597.  
  598. /* xpoint - draw a point */
  599. NODE *xpoint(args)
  600.   NODE *args;
  601. {
  602.     int x,y;
  603.     x = xlmatch(INT,&args)->n_int;
  604.     y = xlmatch(INT,&args)->n_int;
  605.     xllastarg(args);
  606.     point(x,y);
  607.     return (NIL);
  608. }
  609.  
  610. /* xcircle - draw a circle */
  611. NODE *xcircle(args)
  612.   NODE *args;
  613. {
  614.     int x,y,r;
  615.     x = xlmatch(INT,&args)->n_int;
  616.     y = xlmatch(INT,&args)->n_int;
  617.     r = xlmatch(INT,&args)->n_int;
  618.     xllastarg(args);
  619.     circle(x,y,r);
  620.     return (NIL);
  621. }
  622.  
  623. /* xaspect - set the aspect ratio */
  624. NODE *xaspect(args)
  625.   NODE *args;
  626. {
  627.     int x,y;
  628.     x = xlmatch(INT,&args)->n_int;
  629.     y = xlmatch(INT,&args)->n_int;
  630.     xllastarg(args);
  631.     set_asp(x,y);
  632.     return (NIL);
  633. }
  634.  
  635. /* xcolors - setup the display colors */
  636. NODE *xcolors(args)
  637.   NODE *args;
  638. {
  639.     int c,p,b;
  640.     c = xlmatch(INT,&args)->n_int;
  641.     p = xlmatch(INT,&args)->n_int;
  642.     b = xlmatch(INT,&args)->n_int;
  643.     xllastarg(args);
  644.     color(c);
  645.     palette(p);
  646.     ground(b);
  647.     return (NIL);
  648. }
  649.  
  650. /* xmode - set the display mode */
  651. NODE *xmode(args)
  652.   NODE *args;
  653. {
  654.     int m;
  655.     m = xlmatch(INT,&args)->n_int;
  656.     xllastarg(args);
  657.     mode(m);
  658.     return (NIL);
  659. }
  660.  
  661. #endif DEADCODE
  662.  
  663. /* osfinit - initialize pc specific functions */
  664. osfinit()
  665. {
  666.     xlsubr("DOS",        SUBR,    xdos);
  667.     xlsubr("GET-KEY",        SUBR,    xgetkey);
  668. #ifdef DEADCODE
  669.     xlsubr("SET-CURSOR",    SUBR,    xcursor);
  670.     xlsubr("CLEAR",        SUBR,    xclear);
  671.     xlsubr("CLEAR-EOL",        SUBR,    xeol);
  672.     xlsubr("CLEAR-EOS",        SUBR,    xeos);
  673.     xlsubr("INSERT-LINE",    SUBR,    xlinsert);
  674.     xlsubr("DELETE-LINE",    SUBR,    xldelete);
  675.     xlsubr("INSERT-CHAR",    SUBR,    xcinsert);
  676.     xlsubr("DELETE-CHAR",    SUBR,    xcdelete);
  677.     xlsubr("SET-INVERSE",    SUBR,    xinverse);
  678.     xlsubr("LINE",         SUBR,    xline);
  679.     xlsubr("POINT",        SUBR,    xpoint);
  680.     xlsubr("CIRCLE",        SUBR,    xcircle);
  681.     xlsubr("ASPECT-RATIO",    SUBR,    xaspect);
  682.     xlsubr("COLORS",        SUBR,    xcolors);
  683.     xlsubr("MODE",         SUBR,    xmode);
  684. #endif DEADCODE
  685. }
  686.  
  687.  
  688. SHAR_EOF
  689. fi # end of overwriting check
  690. if test -f 'msstuff.c'
  691. then
  692.     echo shar: will not over-write existing file "'msstuff.c'"
  693. else
  694. cat << \SHAR_EOF > 'msstuff.c'
  695. /* msstuff.c - ms-dos specific routines */
  696.  
  697. #include "xlisp.h"
  698.  
  699. #define LBSIZE 200
  700.  
  701. /* external routines */
  702. extern double ran();
  703.  
  704. /* external variables */
  705. extern NODE *s_unbound,*true;
  706. extern int prompt;
  707. extern int errno;
  708.  
  709. /* line buffer variables */
  710. static char lbuf[LBSIZE];
  711. static int  lpos[LBSIZE];
  712. static int lindex;
  713. static int lcount;
  714. static int lposition;
  715.  
  716. /* osinit - initialize */
  717. osinit(banner)
  718.   char *banner;
  719. {
  720.     printf("%s\n",banner);
  721.     lposition = 0;
  722.     lindex = 0;
  723.     lcount = 0;
  724. }
  725.  
  726. /* osrand - return a random number between 0 and n-1 */
  727. int osrand(n)
  728.   int n;
  729. {
  730.     n = (int)(ran() * (double)n);
  731.     return (n < 0 ? -n : n);
  732. }
  733.  
  734. /* osgetc - get a character from the terminal */
  735. int osgetc(fp)
  736.   FILE *fp;
  737. {
  738.     int ch;
  739.  
  740.     /* check for input from a file other than stdin */
  741.     if (fp != stdin)
  742.     return (agetc(fp));
  743.  
  744.     /* check for a buffered character */
  745.     if (lcount--)
  746.     return (lbuf[lindex++]);
  747.  
  748.     /* get an input line */
  749.     for (lcount = 0; ; )
  750.     switch (ch = xgetc()) {
  751.     case '\r':
  752.         lbuf[lcount++] = '\n';
  753.         xputc('\r'); xputc('\n'); lposition = 0;
  754.         lindex = 0; lcount--;
  755.         return (lbuf[lindex++]);
  756.     case '\010':
  757.     case '\177':
  758.         if (lcount) {
  759.             lcount--;
  760.             while (lposition > lpos[lcount]) {
  761.             xputc('\010'); xputc(' '); xputc('\010');
  762.             lposition--;
  763.             }
  764.         }
  765.         break;
  766.     case '\032':
  767.         osflush();
  768.         return (EOF);
  769.     default:
  770.         if (ch == '\t' || (ch >= 0x20 && ch < 0x7F)) {
  771.             lbuf[lcount] = ch;
  772.             lpos[lcount] = lposition;
  773.             if (ch == '\t')
  774.             do {
  775.                 xputc(' ');
  776.             } while (++lposition & 7);
  777.             else {
  778.             xputc(ch); lposition++;
  779.             }
  780.             lcount++;
  781.         }
  782.         else {
  783.             osflush();
  784.             switch (ch) {
  785.             case '\003':    xltoplevel();    /* control-c */
  786.             case '\007':    xlcleanup();    /* control-g */
  787.             case '\020':    xlcontinue();    /* control-p */
  788.             case '\032':    return (EOF);    /* control-z */
  789.             default:        return (ch);
  790.             }
  791.         }
  792.     }
  793. }
  794.  
  795. /* osputc - put a character to the terminal */
  796. osputc(ch,fp)
  797.   int ch; FILE *fp;
  798. {
  799.     /* check for output to something other than stdout */
  800.     if (fp != stdout)
  801.     return (aputc(ch,fp));
  802.  
  803.     /* check for control characters */
  804.     oscheck();
  805.  
  806.     /* output the character */
  807.     if (ch == '\n') {
  808.     xputc('\r'); xputc('\n');
  809.     lposition = 0;
  810.     }
  811.     else {
  812.     xputc(ch);
  813.     lposition++;
  814.    }
  815. }
  816.  
  817. /* oscheck - check for control characters during execution */
  818. oscheck()
  819. {
  820.     int ch;
  821.     if (ch = xcheck())
  822.     switch (ch) {
  823.     case '\002':    osflush(); xlbreak("BREAK",s_unbound); break;
  824.     case '\003':    osflush(); xltoplevel(); break;
  825.     }
  826. }
  827.  
  828. /* osflush - flush the input line buffer */
  829. osflush()
  830. {
  831.     lindex = lcount = 0;
  832.     osputc('\n',stdout);
  833.     prompt = 1;
  834. }
  835.  
  836. /* xgetc - get a character from the terminal without echo */
  837. static int xgetc()
  838. {
  839.     return (bdos(7));
  840. }
  841.  
  842. /* xputc - put a character to the terminal */
  843. static xputc(ch)
  844.   int ch;
  845. {
  846.     bdos(6,ch);
  847. }
  848.  
  849. /* xcheck - check for a character */
  850. static int xcheck()
  851. {
  852.     return (bdos(6,0xFF));
  853. }
  854.  
  855. /* xdos - execute a dos command */
  856. NODE *xdos(args)
  857.   NODE *args;
  858. {
  859.     char *cmd;
  860.     cmd = xlmatch(STR,&args)->n_str;
  861.     xllastarg(args);
  862.     return (system(cmd) == -1 ? cvfixnum((FIXNUM)errno) : true);
  863. }
  864.  
  865. /* xgetkey - get a key from the keyboard */
  866. NODE *xgetkey(args)
  867.   NODE *args;
  868. {
  869.     xllastarg(args);
  870.     return (cvfixnum((FIXNUM)xgetc()));
  871. }
  872.  
  873. /* osfinit - initialize pc specific functions */
  874. osfinit()
  875. {
  876.     xlsubr("DOS",        SUBR,    xdos);
  877.     xlsubr("GET-KEY",        SUBR,    xgetkey);
  878. }
  879.  
  880. SHAR_EOF
  881. fi # end of overwriting check
  882. if test -f 'pcfun.doc'
  883. then
  884.     echo shar: will not over-write existing file "'pcfun.doc'"
  885. else
  886. cat << \SHAR_EOF > 'pcfun.doc'
  887. PCFUN.MEM
  888. 12/9/85
  889.  
  890. This is a list of IBM-PC specific functions in XLISP version 1.5d.
  891. All of the functions take integers as arguments except where noted.
  892. All of the functions return NIL.
  893.  
  894. (dos <cmd>)  Execute a DOS command
  895.   <cmd>    the command string
  896.  
  897. (get-key)  Get a key from the keyboard
  898.  
  899. (set-cursor <row> <col>)  Set the cursor position
  900.  
  901. (clear)  Clear the screen
  902.  
  903. (clear-eol)  Clear to the end of the current line
  904.  
  905. (clear-eos)  Clear to the end of the screen
  906.  
  907. (insert-line)  Insert a line
  908.  
  909. (delete-line)  Delete a line
  910.  
  911. (insert-char)  Insert a character
  912.  
  913. (delete-char)  Delete a character
  914.  
  915. (set-inverse <mode>)  Set inverse mode
  916.    <mode> is T for inverse, NIL for normal
  917.  
  918. (line <x1> <y1> <x2> <y2>)  Draw a line
  919.  
  920. (point <x> <y>)  Draw a point
  921.  
  922. (circle <x> <y> <radius>)  Draw a circle
  923.  
  924. (aspect-ratio <x> <y>)  Set the aspect ratio for circles
  925.  
  926. (colors <color> <palette> <background>)  Set the display colors
  927.  
  928. (mode <mode>)  Set the display mode
  929.  
  930.  
  931. SHAR_EOF
  932. fi # end of overwriting check
  933. if test -f 'pcstuff.c'
  934. then
  935.     echo shar: will not over-write existing file "'pcstuff.c'"
  936. else
  937. cat << \SHAR_EOF > 'pcstuff.c'
  938. /* pcstuff.c - ibm-pc specific routines */
  939.  
  940. #include "xlisp.h"
  941.  
  942. #define LBSIZE 200
  943.  
  944. /* external routines */
  945. extern double ran();
  946.  
  947. /* external variables */
  948. extern NODE *s_unbound,*true;
  949. extern int prompt;
  950. extern int errno;
  951.  
  952. /* line buffer variables */
  953. static char lbuf[LBSIZE];
  954. static int  lpos[LBSIZE];
  955. static int lindex;
  956. static int lcount;
  957. static int lposition;
  958.  
  959. /* osinit - initialize */
  960. osinit(banner)
  961.   char *banner;
  962. {
  963.     printf("%s\n",banner);
  964.     lposition = 0;
  965.     lindex = 0;
  966.     lcount = 0;
  967. }
  968.  
  969. /* osrand - return a random number between 0 and n-1 */
  970. int osrand(n)
  971.   int n;
  972. {
  973.     n = (int)(ran() * (double)n);
  974.     return (n < 0 ? -n : n);
  975. }
  976.  
  977. /* osgetc - get a character from the terminal */
  978. int osgetc(fp)
  979.   FILE *fp;
  980. {
  981.     int ch;
  982.  
  983.     /* check for input from a file other than stdin */
  984.     if (fp != stdin)
  985.     return (agetc(fp));
  986.  
  987.     /* check for a buffered character */
  988.     if (lcount--)
  989.     return (lbuf[lindex++]);
  990.  
  991.     /* get an input line */
  992.     for (lcount = 0; ; )
  993.     switch (ch = xgetc()) {
  994.     case '\r':
  995.         lbuf[lcount++] = '\n';
  996.         xputc('\r'); xputc('\n'); lposition = 0;
  997.         lindex = 0; lcount--;
  998.         return (lbuf[lindex++]);
  999.     case '\010':
  1000.     case '\177':
  1001.         if (lcount) {
  1002.             lcount--;
  1003.             while (lposition > lpos[lcount]) {
  1004.             xputc('\010'); xputc(' '); xputc('\010');
  1005.             lposition--;
  1006.             }
  1007.         }
  1008.         break;
  1009.     case '\032':
  1010.         osflush();
  1011.         return (EOF);
  1012.     default:
  1013.         if (ch == '\t' || (ch >= 0x20 && ch < 0x7F)) {
  1014.             lbuf[lcount] = ch;
  1015.             lpos[lcount] = lposition;
  1016.             if (ch == '\t')
  1017.             do {
  1018.                 xputc(' ');
  1019.             } while (++lposition & 7);
  1020.             else {
  1021.             xputc(ch); lposition++;
  1022.             }
  1023.             lcount++;
  1024.         }
  1025.         else {
  1026.             osflush();
  1027.             switch (ch) {
  1028.             case '\003':    xltoplevel();    /* control-c */
  1029.             case '\007':    xlcleanup();    /* control-g */
  1030.             case '\020':    xlcontinue();    /* control-p */
  1031.             case '\032':    return (EOF);    /* control-z */
  1032.             default:        return (ch);
  1033.             }
  1034.         }
  1035.     }
  1036. }
  1037.  
  1038. /* osputc - put a character to the terminal */
  1039. osputc(ch,fp)
  1040.   int ch; FILE *fp;
  1041. {
  1042.     /* check for output to something other than stdout */
  1043.     if (fp != stdout)
  1044.     return (aputc(ch,fp));
  1045.  
  1046.     /* check for control characters */
  1047.     oscheck();
  1048.  
  1049.     /* output the character */
  1050.     if (ch == '\n') {
  1051.     xputc('\r'); xputc('\n');
  1052.     lposition = 0;
  1053.     }
  1054.     else {
  1055.     xputc(ch);
  1056.     lposition++;
  1057.    }
  1058. }
  1059.  
  1060. /* oscheck - check for control characters during execution */
  1061. oscheck()
  1062. {
  1063.     int ch;
  1064.     if (ch = xcheck())
  1065.     switch (ch) {
  1066.     case '\002':    osflush(); xlbreak("BREAK",s_unbound); break;
  1067.     case '\003':    osflush(); xltoplevel(); break;
  1068.     }
  1069. }
  1070.  
  1071. /* osflush - flush the input line buffer */
  1072. osflush()
  1073. {
  1074.     lindex = lcount = 0;
  1075.     osputc('\n',stdout);
  1076.     prompt = 1;
  1077. }
  1078.  
  1079. /* xgetc - get a character from the terminal without echo */
  1080. static int xgetc()
  1081. {
  1082.     return (scr_getc() & 0xFF);
  1083. }
  1084.  
  1085. /* xputc - put a character to the terminal */
  1086. static xputc(ch)
  1087.   int ch;
  1088. {
  1089.     scr_putc(ch);
  1090. }
  1091.  
  1092. /* xcheck - check for a character */
  1093. static int xcheck()
  1094. {
  1095.     if (scr_poll() == -1)
  1096.     return (0);
  1097.     return (scr_getc() & 0xFF);
  1098. }
  1099.  
  1100. /* xdos - execute a dos command */
  1101. NODE *xdos(args)
  1102.   NODE *args;
  1103. {
  1104.     char *cmd;
  1105.     cmd = xlmatch(STR,&args)->n_str;
  1106.     xllastarg(args);
  1107.     return (system(cmd) == -1 ? cvfixnum((FIXNUM)errno) : true);
  1108. }
  1109.  
  1110. /* xgetkey - get a key from the keyboard */
  1111. NODE *xgetkey(args)
  1112.   NODE *args;
  1113. {
  1114.     xllastarg(args);
  1115.     return (cvfixnum((FIXNUM)scr_getc()));
  1116. }
  1117.  
  1118. /* xcursor - set the cursor position */
  1119. NODE *xcursor(args)
  1120.   NODE *args;
  1121. {
  1122.     int row,col;
  1123.     row = xlmatch(INT,&args)->n_int;
  1124.     col = xlmatch(INT,&args)->n_int;
  1125.     xllastarg(args);
  1126.     scr_curs(row,col);
  1127.     return (NIL);
  1128. }
  1129.  
  1130. /* xclear - clear the screen */
  1131. NODE *xclear(args)
  1132.   NODE *args;
  1133. {
  1134.     xllastarg(args);
  1135.     scr_clear();
  1136.     return (NIL);
  1137. }
  1138.  
  1139. /* xeol - clear to end of line */
  1140. NODE *xeol(args)
  1141.   NODE *args;
  1142. {
  1143.     xllastarg(args);
  1144.     scr_eol();
  1145.     return (NIL);
  1146. }
  1147.  
  1148.  
  1149. /* xeos - clear to end of screen */
  1150. NODE *xeos(args)
  1151.   NODE *args;
  1152. {
  1153.     xllastarg(args);
  1154.     scr_eos();
  1155.     return (NIL);
  1156. }
  1157.  
  1158. /* xlinsert - insert line */
  1159. NODE *xlinsert(args)
  1160.   NODE *args;
  1161. {
  1162.     xllastarg(args);
  1163.     scr_linsert();
  1164.     return (NIL);
  1165. }
  1166.  
  1167. /* xldelete - delete line */
  1168. NODE *xldelete(args)
  1169.   NODE *args;
  1170. {
  1171.     xllastarg(args);
  1172.     scr_ldelete();
  1173.     return (NIL);
  1174. }
  1175.  
  1176. /* xcinsert - insert character */
  1177. NODE *xcinsert(args)
  1178.   NODE *args;
  1179. {
  1180.     xllastarg(args);
  1181.     scr_cinsert();
  1182.     return (NIL);
  1183. }
  1184.  
  1185. /* xcdelete - delete character */
  1186. NODE *xcdelete(args)
  1187.   NODE *args;
  1188. {
  1189.     xllastarg(args);
  1190.     scr_cdelete();
  1191.     return (NIL);
  1192. }
  1193.  
  1194. /* xinverse - set/clear inverse video */
  1195. NODE *xinverse(args)
  1196.   NODE *args;
  1197. {
  1198.     NODE *val;
  1199.     val = xlarg(&args);
  1200.     xllastarg(args);
  1201.     scr_invers(val ? 1 : 0);
  1202.     return (NIL);
  1203. }
  1204.  
  1205. /* xline - draw a line */
  1206. NODE *xline(args)
  1207.   NODE *args;
  1208. {
  1209.     int x1,y1,x2,y2;
  1210.     x1 = xlmatch(INT,&args)->n_int;
  1211.     y1 = xlmatch(INT,&args)->n_int;
  1212.     x2 = xlmatch(INT,&args)->n_int;
  1213.     y2 = xlmatch(INT,&args)->n_int;
  1214.     xllastarg(args);
  1215.     line(x1,y1,x2,y2);
  1216.     return (NIL);
  1217. }
  1218.  
  1219. /* xpoint - draw a point */
  1220. NODE *xpoint(args)
  1221.   NODE *args;
  1222. {
  1223.     int x,y;
  1224.     x = xlmatch(INT,&args)->n_int;
  1225.     y = xlmatch(INT,&args)->n_int;
  1226.     xllastarg(args);
  1227.     point(x,y);
  1228.     return (NIL);
  1229. }
  1230.  
  1231. /* xcircle - draw a circle */
  1232. NODE *xcircle(args)
  1233.   NODE *args;
  1234. {
  1235.     int x,y,r;
  1236.     x = xlmatch(INT,&args)->n_int;
  1237.     y = xlmatch(INT,&args)->n_int;
  1238.     r = xlmatch(INT,&args)->n_int;
  1239.     xllastarg(args);
  1240.     circle(x,y,r);
  1241.     return (NIL);
  1242. }
  1243.  
  1244. /* xaspect - set the aspect ratio */
  1245. NODE *xaspect(args)
  1246.   NODE *args;
  1247. {
  1248.     int x,y;
  1249.     x = xlmatch(INT,&args)->n_int;
  1250.     y = xlmatch(INT,&args)->n_int;
  1251.     xllastarg(args);
  1252.     set_asp(x,y);
  1253.     return (NIL);
  1254. }
  1255.  
  1256. /* xcolors - setup the display colors */
  1257. NODE *xcolors(args)
  1258.   NODE *args;
  1259. {
  1260.     int c,p,b;
  1261.     c = xlmatch(INT,&args)->n_int;
  1262.     p = xlmatch(INT,&args)->n_int;
  1263.     b = xlmatch(INT,&args)->n_int;
  1264.     xllastarg(args);
  1265.     color(c);
  1266.     palette(p);
  1267.     ground(b);
  1268.     return (NIL);
  1269. }
  1270.  
  1271. /* xmode - set the display mode */
  1272. NODE *xmode(args)
  1273.   NODE *args;
  1274. {
  1275.     int m;
  1276.     m = xlmatch(INT,&args)->n_int;
  1277.     xllastarg(args);
  1278.     mode(m);
  1279.     return (NIL);
  1280. }
  1281.  
  1282. /* osfinit - initialize pc specific functions */
  1283. osfinit()
  1284. {
  1285.     xlsubr("DOS",        SUBR,    xdos);
  1286.     xlsubr("GET-KEY",        SUBR,    xgetkey);
  1287.     xlsubr("SET-CURSOR",    SUBR,    xcursor);
  1288.     xlsubr("CLEAR",        SUBR,    xclear);
  1289.     xlsubr("CLEAR-EOL",        SUBR,    xeol);
  1290.     xlsubr("CLEAR-EOS",        SUBR,    xeos);
  1291.     xlsubr("INSERT-LINE",    SUBR,    xlinsert);
  1292.     xlsubr("DELETE-LINE",    SUBR,    xldelete);
  1293.     xlsubr("INSERT-CHAR",    SUBR,    xcinsert);
  1294.     xlsubr("DELETE-CHAR",    SUBR,    xcdelete);
  1295.     xlsubr("SET-INVERSE",    SUBR,    xinverse);
  1296.     xlsubr("LINE",         SUBR,    xline);
  1297.     xlsubr("POINT",        SUBR,    xpoint);
  1298.     xlsubr("CIRCLE",        SUBR,    xcircle);
  1299.     xlsubr("ASPECT-RATIO",    SUBR,    xaspect);
  1300.     xlsubr("COLORS",        SUBR,    xcolors);
  1301.     xlsubr("MODE",         SUBR,    xmode);
  1302. }
  1303.  
  1304. SHAR_EOF
  1305. fi # end of overwriting check
  1306. if test -f 'psstuff.c'
  1307. then
  1308.     echo shar: will not over-write existing file "'psstuff.c'"
  1309. else
  1310. cat << \SHAR_EOF > 'psstuff.c'
  1311. /* pcstuff.c - ibm-pc specific routines */
  1312.  
  1313. #include "xlisp.h"
  1314.  
  1315. #define LBSIZE 200
  1316.  
  1317. /* external routines */
  1318. extern double ran();
  1319.  
  1320. /* external variables */
  1321. extern NODE *s_unbound,*true;
  1322. extern int prompt;
  1323. extern int errno;
  1324.  
  1325. /* line buffer variables */
  1326. static char lbuf[LBSIZE];
  1327. static int  lpos[LBSIZE];
  1328. static int lindex;
  1329. static int lcount;
  1330. static int lposition;
  1331.  
  1332. /* osinit - initialize */
  1333. osinit(banner)
  1334.   char *banner;
  1335. {
  1336.     printf("%s\n",banner);
  1337.     lposition = 0;
  1338.     lindex = 0;
  1339.     lcount = 0;
  1340. }
  1341.  
  1342. /* osrand - return a random number between 0 and n-1 */
  1343. int osrand(n)
  1344.   int n;
  1345. {
  1346.     n = (int)(ran() * (double)n);
  1347.     return (n < 0 ? -n : n);
  1348. }
  1349.  
  1350. /* osgetc - get a character from the terminal */
  1351. int osgetc(fp)
  1352.   FILE *fp;
  1353. {
  1354.     int ch;
  1355.  
  1356.     /* check for input from a file other than stdin */
  1357.     if (fp != stdin)
  1358.     return (agetc(fp));
  1359.  
  1360.     /* check for a buffered character */
  1361.     if (lcount--)
  1362.     return (lbuf[lindex++]);
  1363.  
  1364.     /* get an input line */
  1365.     for (lcount = 0; ; )
  1366.     switch (ch = xgetc()) {
  1367.     case '\r':
  1368.         lbuf[lcount++] = '\n';
  1369.         xputc('\r'); xputc('\n'); lposition = 0;
  1370.         lindex = 0; lcount--;
  1371.         return (lbuf[lindex++]);
  1372.     case '\010':
  1373.     case '\177':
  1374.         if (lcount) {
  1375.             lcount--;
  1376.             while (lposition > lpos[lcount]) {
  1377.             xputc('\010'); xputc(' '); xputc('\010');
  1378.             lposition--;
  1379.             }
  1380.         }
  1381.         break;
  1382.     case '\032':
  1383.         osflush();
  1384.         return (EOF);
  1385.     default:
  1386.         if (ch == '\t' || (ch >= 0x20 && ch < 0x7F)) {
  1387.             lbuf[lcount] = ch;
  1388.             lpos[lcount] = lposition;
  1389.             if (ch == '\t')
  1390.             do {
  1391.                 xputc(' ');
  1392.             } while (++lposition & 7);
  1393.             else {
  1394.             xputc(ch); lposition++;
  1395.             }
  1396.             lcount++;
  1397.         }
  1398.         else {
  1399.             osflush();
  1400.             switch (ch) {
  1401.             case '\003':    xltoplevel();    /* control-c */
  1402.             case '\007':    xlcleanup();    /* control-g */
  1403.             case '\020':    xlcontinue();    /* control-p */
  1404.             case '\032':    return (EOF);    /* control-z */
  1405.             default:        return (ch);
  1406.             }
  1407.         }
  1408.     }
  1409. }
  1410.  
  1411. /* osputc - put a character to the terminal */
  1412. osputc(ch,fp)
  1413.   int ch; FILE *fp;
  1414. {
  1415.     /* check for output to something other than stdout */
  1416.     if (fp != stdout)
  1417.     return (aputc(ch,fp));
  1418.  
  1419.     /* check for control characters */
  1420.     oscheck();
  1421.  
  1422.     /* output the character */
  1423.     if (ch == '\n') {
  1424.     xputc('\r'); xputc('\n');
  1425.     lposition = 0;
  1426.     }
  1427.     else {
  1428.     xputc(ch);
  1429.     lposition++;
  1430.    }
  1431. }
  1432.  
  1433. /* oscheck - check for control characters during execution */
  1434. oscheck()
  1435. {
  1436.     int ch;
  1437.     if (ch = xcheck())
  1438.     switch (ch) {
  1439.     case '\002':    osflush(); xlbreak("BREAK",s_unbound); break;
  1440.     case '\003':    osflush(); xltoplevel(); break;
  1441.     }
  1442. }
  1443.  
  1444. /* osflush - flush the input line buffer */
  1445. osflush()
  1446. {
  1447.     lindex = lcount = 0;
  1448.     osputc('\n',stdout);
  1449.     prompt = 1;
  1450. }
  1451.  
  1452. /* xgetc - get a character from the terminal without echo */
  1453. static int xgetc()
  1454. {
  1455.     return (scr_getc() & 0xFF);
  1456. }
  1457.  
  1458. /* xputc - put a character to the terminal */
  1459. static xputc(ch)
  1460.   int ch;
  1461. {
  1462.     scr_putc(ch);
  1463. }
  1464.  
  1465. /* xcheck - check for a character */
  1466. static int xcheck()
  1467. {
  1468.     if (scr_poll() == -1)
  1469.     return (0);
  1470.     return (scr_getc() & 0xFF);
  1471. }
  1472.  
  1473. /* xdos - execute a dos command */
  1474. NODE *xdos(args)
  1475.   NODE *args;
  1476. {
  1477.     char *cmd;
  1478.     cmd = xlmatch(STR,&args)->n_str;
  1479.     xllastarg(args);
  1480.     return (system(cmd) == -1 ? cvfixnum((FIXNUM)errno) : true);
  1481. }
  1482.  
  1483. /* xgetkey - get a key from the keyboard */
  1484. NODE *xgetkey(args)
  1485.   NODE *args;
  1486. {
  1487.     xllastarg(args);
  1488.     return (cvfixnum((FIXNUM)scr_getc()));
  1489. }
  1490.  
  1491. /* xcursor - set the cursor position */
  1492. NODE *xcursor(args)
  1493.   NODE *args;
  1494. {
  1495.     int row,col;
  1496.     row = xlmatch(INT,&args)->n_int;
  1497.     col = xlmatch(INT,&args)->n_int;
  1498.     xllastarg(args);
  1499.     scr_curs(row,col);
  1500.     return (NIL);
  1501. }
  1502.  
  1503. /* xclear - clear the screen */
  1504. NODE *xclear(args)
  1505.   NODE *args;
  1506. {
  1507.     xllastarg(args);
  1508.     scr_clear();
  1509.     return (NIL);
  1510. }
  1511.  
  1512. /* xeol - clear to end of line */
  1513. NODE *xeol(args)
  1514.   NODE *args;
  1515. {
  1516.     xllastarg(args);
  1517.     scr_eol();
  1518.     return (NIL);
  1519. }
  1520.  
  1521.  
  1522. /* xeos - clear to end of screen */
  1523. NODE *xeos(args)
  1524.   NODE *args;
  1525. {
  1526.     xllastarg(args);
  1527.     scr_eos();
  1528.     return (NIL);
  1529. }
  1530.  
  1531. /* xlinsert - insert line */
  1532. NODE *xlinsert(args)
  1533.   NODE *args;
  1534. {
  1535.     xllastarg(args);
  1536.     scr_linsert();
  1537.     return (NIL);
  1538. }
  1539.  
  1540. /* xldelete - delete line */
  1541. NODE *xldelete(args)
  1542.   NODE *args;
  1543. {
  1544.     xllastarg(args);
  1545.     scr_ldelete();
  1546.     return (NIL);
  1547. }
  1548.  
  1549. /* xcinsert - insert character */
  1550. NODE *xcinsert(args)
  1551.   NODE *args;
  1552. {
  1553.     xllastarg(args);
  1554.     scr_cinsert();
  1555.     return (NIL);
  1556. }
  1557.  
  1558. /* xcdelete - delete character */
  1559. NODE *xcdelete(args)
  1560.   NODE *args;
  1561. {
  1562.     xllastarg(args);
  1563.     scr_cdelete();
  1564.     return (NIL);
  1565. }
  1566.  
  1567. /* xinverse - set/clear inverse video */
  1568. NODE *xinverse(args)
  1569.   NODE *args;
  1570. {
  1571.     NODE *val;
  1572.     val = xlarg(&args);
  1573.     xllastarg(args);
  1574.     scr_invers(val ? 1 : 0);
  1575.     return (NIL);
  1576. }
  1577.  
  1578. /* xline - draw a line */
  1579. NODE *xline(args)
  1580.   NODE *args;
  1581. {
  1582.     int x1,y1,x2,y2;
  1583.     x1 = xlmatch(INT,&args)->n_int;
  1584.     y1 = xlmatch(INT,&args)->n_int;
  1585.     x2 = xlmatch(INT,&args)->n_int;
  1586.     y2 = xlmatch(INT,&args)->n_int;
  1587.     xllastarg(args);
  1588.     line(x1,y1,x2,y2);
  1589.     return (NIL);
  1590. }
  1591.  
  1592. /* xpoint - draw a point */
  1593. NODE *xpoint(args)
  1594.   NODE *args;
  1595. {
  1596.     int x,y;
  1597.     x = xlmatch(INT,&args)->n_int;
  1598.     y = xlmatch(INT,&args)->n_int;
  1599.     xllastarg(args);
  1600.     point(x,y);
  1601.     return (NIL);
  1602. }
  1603.  
  1604. /* xcircle - draw a circle */
  1605. NODE *xcircle(args)
  1606.   NODE *args;
  1607. {
  1608.     int x,y,r;
  1609.     x = xlmatch(INT,&args)->n_int;
  1610.     y = xlmatch(INT,&args)->n_int;
  1611.     r = xlmatch(INT,&args)->n_int;
  1612.     xllastarg(args);
  1613.     circle(x,y,r);
  1614.     return (NIL);
  1615. }
  1616.  
  1617. /* xaspect - set the aspect ratio */
  1618. NODE *xaspect(args)
  1619.   NODE *args;
  1620. {
  1621.     int x,y;
  1622.     x = xlmatch(INT,&args)->n_int;
  1623.     y = xlmatch(INT,&args)->n_int;
  1624.     xllastarg(args);
  1625.     set_asp(x,y);
  1626.     return (NIL);
  1627. }
  1628.  
  1629. /* xcolors - setup the display colors */
  1630. NODE *xcolors(args)
  1631.   NODE *args;
  1632. {
  1633.     int c,p,b;
  1634.     c = xlmatch(INT,&args)->n_int;
  1635.     p = xlmatch(INT,&args)->n_int;
  1636.     b = xlmatch(INT,&args)->n_int;
  1637.     xllastarg(args);
  1638.     color(c);
  1639.     palette(p);
  1640.     ground(b);
  1641.     return (NIL);
  1642. }
  1643.  
  1644. /* xmode - set the display mode */
  1645. NODE *xmode(args)
  1646.   NODE *args;
  1647. {
  1648.     int m;
  1649.     m = xlmatch(INT,&args)->n_int;
  1650.     xllastarg(args);
  1651.     mode(m);
  1652.     return (NIL);
  1653. }
  1654.  
  1655. /* osfinit - initialize pc specific functions */
  1656. osfinit()
  1657. {
  1658.     xlsubr("DOS",        SUBR,    xdos);
  1659.     xlsubr("GET-KEY",        SUBR,    xgetkey);
  1660.     xlsubr("SET-CURSOR",    SUBR,    xcursor);
  1661.     xlsubr("CLEAR",        SUBR,    xclear);
  1662.     xlsubr("CLEAR-EOL",        SUBR,    xeol);
  1663.     xlsubr("CLEAR-EOS",        SUBR,    xeos);
  1664.     xlsubr("INSERT-LINE",    SUBR,    xlinsert);
  1665.     xlsubr("DELETE-LINE",    SUBR,    xldelete);
  1666.     xlsubr("INSERT-CHAR",    SUBR,    xcinsert);
  1667.     xlsubr("DELETE-CHAR",    SUBR,    xcdelete);
  1668.     xlsubr("SET-INVERSE",    SUBR,    xinverse);
  1669.     xlsubr("LINE",         SUBR,    xline);
  1670.     xlsubr("POINT",        SUBR,    xpoint);
  1671.     xlsubr("CIRCLE",        SUBR,    xcircle);
  1672.     xlsubr("ASPECT-RATIO",    SUBR,    xaspect);
  1673.     xlsubr("COLORS",        SUBR,    xcolors);
  1674.     xlsubr("MODE",         SUBR,    xmode);
  1675. }
  1676.  
  1677.  
  1678. SHAR_EOF
  1679. fi # end of overwriting check
  1680. if test -f 'readme.1st'
  1681. then
  1682.     echo shar: will not over-write existing file "'readme.1st'"
  1683. else
  1684. cat << \SHAR_EOF > 'readme.1st'
  1685. XLISP version 1.6
  1686. January 6, 1985
  1687.  
  1688. README   1ST    This file
  1689. XLISP    DOC    XLISP documentation
  1690. PCFUN    DOC    PC specific function definitions
  1691. XLISPPC  EXE    XLISP executable for IBM-PC compatibles
  1692. XLISPMS  EXE    XLISP executable for generic MS-DOS
  1693. PCTURTLE LSP    IBM-PC turtle graphics demo program
  1694. INIT     LSP    XLISP initialization file
  1695. FACT     LSP    Factorial function
  1696. FIB      LSP    Fibonacci function
  1697. PROLOG   LSP    Tiny Prolog interpreter
  1698. PT       LSP    Turtle graphics demo for ANSI terminals
  1699. TRACE    LSP    A simple trace facility
  1700. PP       LSP    Pretty printer
  1701. ART      LSP    Code from my 3/85 Byte article
  1702. XLISP    ARC    XLISP source code (archive)
  1703. ARC      EXE    File archiver program
  1704.  
  1705. To extract the XLISP source files from the XLISP.ARC archive, type the
  1706. following command:
  1707.  
  1708.     arc e xlisp *.*
  1709.  
  1710.  
  1711.  
  1712. SHAR_EOF
  1713. fi # end of overwriting check
  1714. if test -f 'unixstuff.c'
  1715. then
  1716.     echo shar: will not over-write existing file "'unixstuff.c'"
  1717. else
  1718. cat << \SHAR_EOF > 'unixstuff.c'
  1719. /* unixstuff.c - unix specific routines */
  1720.  
  1721. #include "xlisp.h"
  1722.  
  1723. /* external routines */
  1724. extern int rand();
  1725.  
  1726.  
  1727. /* osinit - initialize */
  1728. osinit(banner)
  1729.   char *banner;
  1730. {
  1731.     printf("%s\n",banner);
  1732. }
  1733.  
  1734. /* osrand - return a random number between 0 and n-1 */
  1735. int osrand(n)
  1736.   int n;
  1737. {
  1738.     return((int)(rand()/4294967296.0 * (double)n));
  1739. }
  1740.  
  1741. /* osgetc - get a character from the terminal */
  1742. int osgetc(fp)
  1743.   FILE *fp;
  1744. {
  1745.     return(getc(fp));
  1746. }
  1747.  
  1748. /* osputc - put a character to the terminal */
  1749. osputc(ch,fp)
  1750.   int ch; FILE *fp;
  1751. {
  1752.     putc(ch, fp);
  1753. }
  1754.  
  1755. /* oscheck - check for control characters during execution */
  1756. oscheck()
  1757. {
  1758.     /* NIX */
  1759. }
  1760.  
  1761. /* osfinit - initialize pc specific functions */
  1762. osfinit()
  1763. {
  1764.     /* NIX */
  1765. }
  1766.  
  1767. /* osfinish - cleanup before exit */
  1768. osfinish()
  1769. {
  1770.     /* NIX */
  1771. }
  1772.  
  1773. SHAR_EOF
  1774. fi # end of overwriting check
  1775. if test -f 'xlisp.h'
  1776. then
  1777.     echo shar: will not over-write existing file "'xlisp.h'"
  1778. else
  1779. cat << \SHAR_EOF > 'xlisp.h'
  1780. /* xlisp - a small subset of lisp */
  1781. /*    Copyright (c) 1985, by David Michael Betz
  1782.     All Rights Reserved
  1783.     Permission is granted for unrestricted non-commercial use    */
  1784.  
  1785. /* system specific definitions */
  1786. /* #define unix */
  1787.  
  1788. #include <stdio.h>
  1789. #include <ctype.h>
  1790. #ifndef MEGAMAX
  1791. #include <setjmp.h>
  1792. #endif
  1793.  
  1794. /* NNODES    number of nodes to allocate in each request (1000) */
  1795. /* TDEPTH    trace stack depth (500) */
  1796. /* EDEPTH    evaluation stack depth (1000) */
  1797. /* FORWARD    type of a forward declaration () */
  1798. /* LOCAL    type of a local function (static) */
  1799. /* AFMT        printf format for addresses ("%x") */
  1800. /* FIXNUM    data type for fixed point numbers (long) */
  1801. /* ITYPE    fixed point input conversion routine type (long atol()) */
  1802. /* ICNV        fixed point input conversion routine (atol) */
  1803. /* IFMT        printf format for fixed point numbers ("%ld") */
  1804. /* FLONUM    data type for floating point numbers (float) */
  1805. /* SYSTEM    enable the control-d command */
  1806.  
  1807. /* absolute value macros */
  1808. #ifndef abs
  1809. #define abs(n)    ((n) < 0 ? -(n) : (n))
  1810. #endif
  1811. #ifndef fabs
  1812. #define fabs(n)    ((n) < 0.0 ? -(n) : (n))
  1813. #endif
  1814.  
  1815. /* for the MegaMax compiler */
  1816. #ifdef MEGAMAX
  1817. #define LOCAL
  1818. #define AFMT        "%lx"
  1819. #endif
  1820.  
  1821. /* for the AZTEC C compiler - small model */
  1822. #ifdef AZTEC_SM
  1823. #define SYSTEM
  1824. #define NIL        0
  1825. #endif
  1826.  
  1827. /* for the AZTEC C compiler - large model */
  1828. #ifdef AZTEC_LM
  1829. #define FLONUM        double
  1830. #define SYSTEM
  1831. #define NIL        0L
  1832. #endif
  1833.  
  1834. /* for the Lattice C compiler (Amiga) */
  1835. #ifdef LATTICE
  1836. #undef fabs
  1837. #endif
  1838.  
  1839. /* default important definitions */
  1840. #ifndef NNODES
  1841. #define NNODES        1000
  1842. #endif
  1843. #ifndef TDEPTH
  1844. #define TDEPTH        500
  1845. #endif
  1846. #ifndef EDEPTH
  1847. #define EDEPTH        1000
  1848. #endif
  1849. #ifndef FORWARD
  1850. #define FORWARD
  1851. #endif
  1852. #ifndef LOCAL
  1853. #define LOCAL        static
  1854. #endif
  1855. #ifndef AFMT
  1856. #define AFMT        "%x"
  1857. #endif
  1858. #ifndef FIXNUM
  1859. #define FIXNUM        long
  1860. #endif
  1861. #ifndef ITYPE
  1862. #define ITYPE        long atol()
  1863. #endif
  1864. #ifndef ICNV
  1865. #define ICNV(n)        atol(n)
  1866. #endif
  1867. #ifndef IFMT
  1868. #define IFMT        "%ld"
  1869. #endif
  1870. #ifndef FLONUM
  1871. #define FLONUM        float
  1872. #endif
  1873.  
  1874. /* useful definitions */
  1875. #define TRUE    1
  1876. #define FALSE    0
  1877. #ifndef NIL
  1878. #define NIL    (NODE *)0
  1879. #endif
  1880.  
  1881. /* program limits */
  1882. #define STRMAX        100        /* maximum length of a string constant */
  1883. #define HSIZE        199        /* symbol hash table size */
  1884. #define SAMPLE        100        /* control character sample rate */
  1885.     
  1886. /* node types */
  1887. #define FREE    0
  1888. #define SUBR    1
  1889. #define FSUBR    2
  1890. #define LIST    3
  1891. #define SYM    4
  1892. #define INT    5
  1893. #define STR    6
  1894. #define OBJ    7
  1895. #define FPTR    8
  1896. #define FLOAT    9
  1897. #define VECT    10
  1898.  
  1899. /* node flags */
  1900. #define MARK    1
  1901. #define LEFT    2
  1902.  
  1903. /* string types */
  1904. #define DYNAMIC    0
  1905. #define STATIC    1
  1906.  
  1907. /* new node access macros */
  1908. #define ntype(x)    ((x)->n_type)
  1909.  
  1910. /* type predicates */
  1911. #define atom(x)        ((x) == NIL || (x)->n_type != LIST)
  1912. #define null(x)        ((x) == NIL)
  1913. #define listp(x)    ((x) == NIL || (x)->n_type == LIST)
  1914. #define consp(x)    ((x) && (x)->n_type == LIST)
  1915. #define subrp(x)    ((x) && (x)->n_type == SUBR)
  1916. #define fsubrp(x)    ((x) && (x)->n_type == FSUBR)
  1917. #define stringp(x)    ((x) && (x)->n_type == STR)
  1918. #define symbolp(x)    ((x) && (x)->n_type == SYM)
  1919. #define filep(x)    ((x) && (x)->n_type == FPTR)
  1920. #define objectp(x)    ((x) && (x)->n_type == OBJ)
  1921. #define fixp(x)        ((x) && (x)->n_type == INT)
  1922. #define floatp(x)    ((x) && (x)->n_type == FLOAT)
  1923. #define vectorp(x)    ((x) && (x)->n_type == VECT)
  1924.  
  1925. /* cons access macros */
  1926. #define car(x)        ((x)->n_car)
  1927. #define cdr(x)        ((x)->n_cdr)
  1928. #define rplaca(x,y)    ((x)->n_car = (y))
  1929. #define rplacd(x,y)    ((x)->n_cdr = (y))
  1930.  
  1931. /* symbol access macros */
  1932. #define getvalue(x)    ((x)->n_symvalue)
  1933. #define setvalue(x,v)    ((x)->n_symvalue = (v))
  1934. #define getplist(x)    ((x)->n_symplist->n_cdr)
  1935. #define setplist(x,v)    ((x)->n_symplist->n_cdr = (v))
  1936. #define getpname(x)    ((x)->n_symplist->n_car)
  1937.  
  1938. /* vector access macros */
  1939. #define getsize(x)    ((x)->n_vsize)
  1940. #define getelement(x,i)    ((x)->n_vdata[i])
  1941. #define setelement(x,i,v) ((x)->n_vdata[i] = (v))
  1942.  
  1943. /* object access macros */
  1944. #define getclass(x)    ((x)->n_vdata[0])
  1945. #define getivar(x,i)    ((x)->n_vdata[i+1])
  1946. #define setivar(x,i,v)    ((x)->n_vdata[i+1] = (v))
  1947.  
  1948. /* subr/fsubr access macros */
  1949. #define getsubr(x)    ((x)->n_subr)
  1950.  
  1951. /* fixnum/flonum access macros */
  1952. #define getfixnum(x)    ((x)->n_int)
  1953. #define getflonum(x)    ((x)->n_float)
  1954.  
  1955. /* string access macros */
  1956. #define getstring(x)    ((x)->n_str)
  1957. #define setstring(x,v)    ((x)->n_str = (v))
  1958.  
  1959. /* file access macros */
  1960. #define getfile(x)    ((x)->n_fp)
  1961. #define setfile(x,v)    ((x)->n_fp = (v))
  1962. #define getsavech(x)    ((x)->n_savech)
  1963. #define setsavech(x,v)    ((x)->n_savech = (v))
  1964.  
  1965. /* symbol node */
  1966. #define n_symplist    n_info.n_xsym.xsy_plist
  1967. #define n_symvalue    n_info.n_xsym.xsy_value
  1968.  
  1969. /* subr/fsubr node */
  1970. #define n_subr        n_info.n_xsubr.xsu_subr
  1971.  
  1972. /* list node */
  1973. #define n_car        n_info.n_xlist.xl_car
  1974. #define n_cdr        n_info.n_xlist.xl_cdr
  1975.  
  1976. /* integer node */
  1977. #define n_int        n_info.n_xint.xi_int
  1978.  
  1979. /* float node */
  1980. #define n_float        n_info.n_xfloat.xf_float
  1981.  
  1982. /* string node */
  1983. #define n_str        n_info.n_xstr.xst_str
  1984. #define n_strtype    n_info.n_xstr.xst_type
  1985.  
  1986. /* file pointer node */
  1987. #define n_fp        n_info.n_xfptr.xf_fp
  1988. #define n_savech    n_info.n_xfptr.xf_savech
  1989.  
  1990. /* vector/object node */
  1991. #define n_vsize        n_info.n_xvect.xv_size
  1992. #define n_vdata        n_info.n_xvect.xv_data
  1993.  
  1994. /* node structure */
  1995. typedef struct node {
  1996.     char n_type;        /* type of node */
  1997.     char n_flags;        /* flag bits */
  1998.     union {            /* value */
  1999.     struct xsym {        /* symbol node */
  2000.         struct node *xsy_plist;    /* symbol plist - (name . plist) */
  2001.         struct node *xsy_value;    /* the current value */
  2002.     } n_xsym;
  2003.     struct xsubr {        /* subr/fsubr node */
  2004.         struct node *(*xsu_subr)();    /* pointer to an internal routine */
  2005.     } n_xsubr;
  2006.     struct xlist {        /* list node (cons) */
  2007.         struct node *xl_car;    /* the car pointer */
  2008.         struct node *xl_cdr;    /* the cdr pointer */
  2009.     } n_xlist;
  2010.     struct xint {        /* integer node */
  2011.         FIXNUM xi_int;        /* integer value */
  2012.     } n_xint;
  2013.     struct xfloat {        /* float node */
  2014.         FLONUM xf_float;        /* float value */
  2015.     } n_xfloat;
  2016.     struct xstr {        /* string node */
  2017.         int xst_type;        /* string type */
  2018.         char *xst_str;        /* string pointer */
  2019.     } n_xstr;
  2020.     struct xfptr {        /* file pointer node */
  2021.         FILE *xf_fp;        /* the file pointer */
  2022.         int xf_savech;        /* lookahead character for input files */
  2023.     } n_xfptr;
  2024.     struct xvect {        /* vector node */
  2025.         int xv_size;        /* vector size */
  2026.         struct node **xv_data;    /* vector data */
  2027.     } n_xvect;
  2028.     } n_info;
  2029. } NODE;
  2030.  
  2031. /* execution context flags */
  2032. #define CF_GO        1
  2033. #define CF_RETURN    2
  2034. #define CF_THROW    4
  2035. #define CF_ERROR    8
  2036. #define CF_CLEANUP    16
  2037. #define CF_CONTINUE    32
  2038. #define CF_TOPLEVEL    64
  2039.  
  2040. /* execution context */
  2041. typedef struct context {
  2042.     int c_flags;            /* context type flags */
  2043.     struct node *c_expr;        /* expression (type dependant) */
  2044.     jmp_buf c_jmpbuf;            /* longjmp context */
  2045.     struct context *c_xlcontext;    /* old value of xlcontext */
  2046.     struct node ***c_xlstack;        /* old value of xlstack */
  2047.     struct node *c_xlenv;        /* old value of xlenv */
  2048.     int c_xltrace;            /* old value of xltrace */
  2049. } CONTEXT;
  2050.  
  2051. /* function table entry structure */
  2052. struct fdef {
  2053.     char *f_name;            /* function name */
  2054.     int f_type;                /* function type SUBR/FSUBR */
  2055.     struct node *(*f_fcn)();        /* function code */
  2056. };
  2057.  
  2058. /* memory segment structure definition */
  2059. struct segment {
  2060.     int sg_size;
  2061.     struct segment *sg_next;
  2062.     struct node sg_nodes[1];
  2063. };
  2064.  
  2065. /* external procedure declarations */
  2066. extern struct node ***xlsave();        /* generate a stack frame */
  2067. extern struct node *xleval();        /* evaluate an expression */
  2068. extern struct node *xlapply();        /* apply a function to arguments */
  2069. extern struct node *xlevlist();        /* evaluate a list of arguments */
  2070. extern struct node *xlarg();        /* fetch an argument */
  2071. extern struct node *xlevarg();        /* fetch and evaluate an argument */
  2072. extern struct node *xlmatch();        /* fetch an typed argument */
  2073. extern struct node *xlevmatch();    /* fetch and evaluate a typed arg */
  2074. extern struct node *xlgetfile();    /* fetch a file/stream argument */
  2075. extern struct node *xlsend();        /* send a message to an object */
  2076. extern struct node *xlenter();        /* enter a symbol */
  2077. extern struct node *xlsenter();        /* enter a symbol with a static pname */
  2078. extern struct node *xlmakesym();    /* make an uninterned symbol */
  2079. extern struct node *xlframe();        /* establish a new environment frame */
  2080. extern struct node *xlgetvalue();    /* get value of a symbol (checked) */
  2081. extern struct node *xlxgetvalue();    /* get value of a symbol */
  2082. extern struct node *xlygetvalue();    /* get value of a symbol (no ivars) */
  2083.  
  2084. extern struct node *cons();        /* (cons x y) */
  2085. extern struct node *consa();        /* (cons x nil) */
  2086. extern struct node *consd();        /* (cons nil x) */
  2087.  
  2088. extern struct node *cvsymbol();        /* convert a string to a symbol */
  2089. extern struct node *cvcsymbol();    /* (same but constant string) */
  2090. extern struct node *cvstring();        /* convert a string */
  2091. extern struct node *cvcstring();    /* (same but constant string) */
  2092. extern struct node *cvfile();        /* convert a FILE * to a file */
  2093. extern struct node *cvsubr();        /* convert a function to a subr/fsubr */
  2094. extern struct node *cvfixnum();        /* convert a fixnum */
  2095. extern struct node *cvflonum();        /* convert a flonum */
  2096.  
  2097. extern struct node *newstring();    /* create a new string */
  2098. extern struct node *newvector();    /* create a new vector */
  2099. extern struct node *newobject();    /* create a new object */
  2100.  
  2101. extern struct node *xlgetprop();    /* get the value of a property */
  2102. extern char *xlsymname();        /* get the print name of a symbol */
  2103.  
  2104. extern void xlsetvalue();
  2105. extern void xlprint();
  2106. extern void xltest();
  2107.  
  2108. SHAR_EOF
  2109. fi # end of overwriting check
  2110. #    End of shell archive
  2111. exit 0
  2112.